﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<cludg.Domain.Content.Stories.Story>" %>
<%@ Import Namespace="cludg.Web.Core.RenderHelpers" %>
<%@ Import Namespace="cludg.Web.RenderHelpers" %>
<div class="title">
	<h1>
		<%: Html.StoryLink(Model.Title, Model)%></h1>
</div>
<div class="content">
	<% Html.StorySubject(Model.Subject); %>
	<%-- Model.Body - содержит html. чтобы теги не кодировались используем %= --%>
	<%= Model.Body%>
</div>
<br style="clear: left" />
<% if (Model.Author != null)
   { %>
<%: Html.RenderImage(Model.Author.SmallAvatar, "avatar") %>
<% } %>
<div class="creationTime">
	<%: Html.RenderDateTime(Model.CreationTime)%>
</div>
<div class="author">
	<% if (Model.Author != null)
	{ %>
	<%: Html.ProfileLink(Model.Author)%>
	<% } %>
</div>
<div class="author">
	Предложил:
	<% if (Model.OfferAuthor != null)
	{ %>
	<%:Html.ProfileLink(Model.OfferAuthor)%>
	<%}
	else
	{%>
	<%:Model.AnonymouseAuthorName%>
	<%
		}%>
</div>
<div class="storyTags">
	Метки:
	<%: Html.TagLinks(Model.Tags) %>
</div>
<% if (Html.HasPermission("DeleteStory", Model) || Html.HasPermission("EditStory", Model))
   {%>
<div class="adminactions">
	<% if (Html.HasPermission("EditStory", Model))
	{ %>
	<%: Html.ActionLink("Изменить", "Edit", "Story", new { id = Model.Id }, null) %>
	<% } %>
	<% if (Html.HasPermission("DeleteStory", Model))
	{ %>
	<%: Html.ActionLink("Удалить", "Delete", "Story", new { id = Model.Id }, null) %>
	<% } %>
</div>
<% } %>
<br style="clear: both" />
